package com.x.crm.http.response.login;

import com.x.crm.http.request.FollowListRequest;
import com.x.crm.model.Customer;
import com.x.crm.model.CustomerLevel;
import com.x.crm.util.IntentionQuery;
import com.x.security.model.Resource;
import com.x.security.model.Role;

import java.util.ArrayList;
import java.util.List;

public class ConvertUtil {
    public static List<CrmRole> convertRoleList(List<Role> roleList) {
        List<CrmRole> result = new ArrayList<CrmRole>();
        for(Role role : roleList){
            CrmRole crmRole = new CrmRole(role);
            result.add(crmRole);
        }
        return result;
    }

    public static List<CrmResource> convertResourceList(List<Resource> resourceList) {
        List<CrmResource> result = new ArrayList<CrmResource>();
        for(Resource resource : resourceList){
            CrmResource crmResource = new CrmResource(resource);
            result.add(crmResource);
        }
        return result;
    }

//    public static IntentionQuery convert(FollowListRequest followListRequest) {
//        IntentionQuery result = new IntentionQuery();
//        String carOnly = followListRequest.getCarOnly();
//        result.setCarOnly(carOnly);
//        String channelId = followListRequest.getChannelId();
//        Customer customer = new Customer();
//        customer.setChannelId(channelId);
//        String customerLevelId = followListRequest.getCustomerLevelId();
//        CustomerLevel customerLevel = new CustomerLevel();
//        customerLevel.setLevelId(customerLevelId);
//        customer.setCustomerLevel(customerLevel);
//        String fuzzyQuery = followListRequest.getFuzzyQuery();
//        customer.setCustomerName(fuzzyQuery);
//        customer.setCustomerPhone(fuzzyQuery);
//        result.setCustomer(customer);
//        String intentionStatus = followListRequest.getIntentionStatus();
//        result.setIntentionState(intentionStatus);
//        result.setOrderRuleList(followListRequest.getOrderRules());
//        result.setPageIndex(followListRequest.getPageNo());
//        result.setPageSize(followListRequest.getPageSize());
//        return result;
//    }
}
